<div id="tab{{$index}}" class="tab-pane @if($index==0) active @endif" style="margin-top: 20px;">
    <table id="sample-table-2"
           class="table table-striped table-bordered table-hover dataTable del-table"
           aria-describedby="sample-table-2_info">
        <thead>
        <tr role="row">
            <th>级别</th>
            <th>类型</th>
            <th>名称</th>
            <th>值</th>
        </tr>
        </thead>
        <tbody>
        <tr class="odd">
            <td>一级菜单:</td>
            <td>
                <select class="type" name="buttons[{{$index}}][type]">
                    <option value="click" @if(isset($button["type"]) and $button["type"] == 'click') selected @endif>
                        click
                    </option>

                    <option value="view" @if(isset($button["type"]) and $button["type"] == 'view') selected @endif>
                        view
                    </option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[{{$index}}][name]" value="{{$button['name'] or ''}}">
            </td>
            <td>
                <input type="text" name="buttons[{{$index}}][value]"
                       @if (isset($button["key"]))
                       value="{{$button["key"]}}"
                       @elseif (isset($button["url"]))
                       value="{{$button["url"]}}"
                       @else
                       value=""
                        @endif
                >
            </td>
        </tr>

        @for ($i = 0; $i < 5; $i++)
            <tr class="odd">
                <td>二级菜单:{{$i+1}}</td>
                <td>
                    <select name="buttons[{{$index}}][sub_button][{{$i}}][type]">
                        <option value="click"
                                @if(isset($button['sub_button']["$i"]["type"]) and $button['sub_button']["$i"]["type"]== 'click') selected @endif>
                            click
                        </option>

                        <option value="view"
                                @if(isset($button['sub_button']["$i"]["type"]) and $button['sub_button']["$i"]["type"] == 'view') selected @endif>
                            view
                        </option>
                    </select>
                </td>
                <td>
                    <input type="text" name="buttons[{{$index}}][sub_button][{{$i}}][name]"
                           value="{{$button['sub_button']["$i"]["name"] or ''}}">
                </td>
                <td>
                    <input type="text" name="buttons[{{$index}}][sub_button][{{$i}}][value]"
                           @if (isset($button['sub_button']["$i"]["key"]))
                                value="{{$button['sub_button']["$i"]["key"]}}"
                           @elseif (isset($button['sub_button']["$i"]["url"]))
                                value="{{$button['sub_button']["$i"]["url"]}}"
                           @else
                                value=""
                            @endif
                    >
                </td>
            </tr>
            @endfor


        </tbody>
    </table>

</div>

<div id="profile" class="tab-pane" style="margin-top: 20px;">
    <table id="sample-table-2"
           class="table table-striped table-bordered table-hover dataTable del-table"
           aria-describedby="sample-table-2_info">
        <thead>
        <tr role="row">
            <th>级别</th>
            <th>类型</th>
            <th>名称</th>
            <th>值</th>
        </tr>
        </thead>
        <tbody>
        <tr class="odd">
            <td>一级菜单:</td>
            <td>
                <select name="buttons[0]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[0]['name']">
            </td>
            <td>
                <input type="text" name="buttons[0]['value']">
            </td>
        </tr>
        <tr class="odd">
            <td>二级菜单:1</td>
            <td>
                <select name="buttons[0]['sub_button'][1]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[0]['sub_button'][1]['name']">
            </td>
            <td>
                <input type="text" name="buttons[0]['sub_button'][1]['value']">
            </td>
        </tr>
        <tr class="odd">
            <td>二级菜单:2</td>
            <td>
                <select name="buttons[1]['sub_button'][2]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][2]['name']">
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][2]['value']">
            </td>
        </tr>
        <tr class="odd">
            <td>二级菜单:3</td>
            <td>
                <select name="buttons[1]['sub_button'][3]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][3]['name']">
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][3]['value']">
            </td>
        </tr>
        <tr class="odd">
            <td>二级菜单:4</td>
            <td>
                <select name="buttons[1]['sub_button'][4]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][4]['name']">
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][4]['value']">
            </td>
        </tr>

        </tbody>
    </table>
</div>

<div id="dropdown" class="tab-pane" style="margin-top: 20px;">
    <table id="sample-table-2"
           class="table table-striped table-bordered table-hover dataTable del-table"
           aria-describedby="sample-table-2_info">
        <thead>
        <tr role="row">
            <th>级别</th>
            <th>类型</th>
            <th>名称</th>
            <th>值</th>
        </tr>
        </thead>
        <tbody>
        <tr class="odd">
            <td>一级菜单:</td>
            <td>
                <select name="buttons[0]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[0]['name']">
            </td>
            <td>
                <input type="text" name="buttons[0]['value']">
            </td>
        </tr>
        <tr class="odd">
            <td>二级菜单:1</td>
            <td>
                <select name="buttons[0]['sub_button'][1]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[0]['sub_button'][1]['name']">
            </td>
            <td>
                <input type="text" name="buttons[0]['sub_button'][1]['value']">
            </td>
        </tr>
        <tr class="odd">
            <td>二级菜单:2</td>
            <td>
                <select name="buttons[1]['sub_button'][2]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][2]['name']">
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][2]['value']">
            </td>
        </tr>
        <tr class="odd">
            <td>二级菜单:3</td>
            <td>
                <select name="buttons[1]['sub_button'][3]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][3]['name']">
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][3]['value']">
            </td>
        </tr>
        <tr class="odd">
            <td>二级菜单:4</td>
            <td>
                <select name="buttons[1]['sub_button'][4]['type']">
                    <option value="">click</option>
                    <option value="">view</option>
                </select>
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][4]['name']">
            </td>
            <td>
                <input type="text" name="buttons[1]['sub_button'][4]['value']">
            </td>
        </tr>

        </tbody>
    </table>
</div>